home *** CD-ROM | disk | FTP | other *** search
/ Aminet 52 / Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso / Aminet / util / moni / Scout-src.lha / netinclude / fcntl.h < prev    next >
C/C++ Source or Header  |  2002-09-16  |  2KB  |  77 lines

  1. #ifndef FCNTL_H
  2. #define FCNTL_H \
  3.        "$Id: fcntl.h,v 1.1.1.1 2001/11/26 22:21:13 tboeckel Exp $"
  4. /*
  5.  *      fcntl.h using AmigaOS 2.04 dos.library 
  6.  *
  7.  *      Copyright © 1994 AmiTCP/IP Group,
  8.  *                       Network Solutions Development, Inc.
  9.  *                       All rights reserved.
  10.  */
  11.  
  12. #ifndef USE_DOSIO
  13. #include <include:fcntl.h>
  14. #else
  15.  
  16. #if defined(__SASC) || defined(__GNUC__)
  17. #ifndef  PROTO_DOS_H
  18. #include <proto/dos.h>
  19. #endif
  20. #else
  21. #ifndef  CLIB_DOS_PROTOS_H
  22. #include <clib/dos_protos.h>
  23. #endif
  24. #endif
  25.  
  26. #ifndef DOS_DOS_H
  27. #include <dos/dos.h>
  28. #endif
  29.  
  30. extern BPTR __dosio_files[3];    /* defined in dosio_init.c, autoinitialized */
  31.  
  32. /*
  33.  * level 1 IO is supported for stdio/stdout/stderr only
  34.  */
  35.  
  36. #ifndef _COMMIFMT_H
  37. #include <sys/commifmt.h>
  38. #endif
  39.  
  40. #if 0 /* not supported */
  41. extern int  open   (const char *, int, ...);
  42. extern int  creat  (const char *, int);
  43. #endif
  44.  
  45. #define read(fd, buf, len) \
  46.   (((unsigned)(fd) < 3) ? Read(__dosio_files[(fd)], (buf), (len)) : -1)
  47.  
  48. #define write(fd, buf, len) \
  49.   (((unsigned)(fd) < 3) ? Write(__dosio_files[(fd)], (buf), (len)) : -1)
  50.  
  51. #define lseek(fd, pos, mode) \
  52.   (((unsigned)(fd) < 3) ? Seek(__dosio_files[(fd)], (pos), (mode)-1) : -1)
  53.  
  54.  
  55. #define tell(x)    lseek(x, 0L, 1)
  56.  
  57. #if 0 /* stdin, stdout, stderr should not be closed */
  58. extern int  close  (int);
  59. #endif
  60.  
  61. #define unlink(name) !DeleteFile((STRPTR)(name))
  62.  
  63. #if 0 /* SAS/C iomode() not supported */
  64. extern int  iomode (int, int);
  65. #endif
  66.  
  67. #define isatty(fd) \
  68.   (((unsigned)(fd) < 3) ? IsInteractive(__dosio_files[(fd)]) & 0x1 : 0)
  69.  
  70. #ifndef _COMMNULL_H
  71. #include <sys/commnull.h>
  72. #endif
  73.  
  74. #endif /* USE_DOSIO */
  75.  
  76. #endif /* FCNTL_H */
  77.